import re

def check_logs(log_file):
    """Check the log file for error messages."""
    error_pattern = re.compile(r'ERROR|Error|error|Failed|failed|FAIL')
    with open(log_file, 'r') as file:
        lines = file.readlines()
    
    errors = [line for line in lines if error_pattern.search(line)]
    
    if errors:
        print("Found the following errors in the log file:")
        for error in errors:
            print(error.strip())
    else:
        print("No errors found in the log file.")

def main():
    log_file = 'system_upgrade.log'  # Change this to your actual log file
    check_logs(log_file)

if __name__ == "__main__":
    main()

